package com.examp.dy.dy.service;

import com.examp.dy.dy.dao.UserRepository;
import com.examp.dy.dy.entities.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {
    @Autowired
    UserRepository userRepository;

    public List<User> getAll(){
        return  userRepository.findAll();
    }
    public User findByuserId(long userId){
        return userRepository.findByuserId(userId);
    }
}
